<template>
  <div class="about">
    <h1>This is an about page</h1>
    <button @click="getList">请求列表</button>
    <button @click="login">登录</button>
    <ul>
      <li v-for="(item,index) in list" :key='index'>
        <img :src="item.image" alt="">
      </li>
    </ul>
  </div>
</template>

<script>
import axios from 'axios' 
// import { get } from '../utils/fetch.js'

export default{
  name:'about',
  data(){
    return{
      list:[]
    }
  },
  created(){
    // this.login();
  },
  methods:{
    login(){
      axios({
        url:'http://49.235.98.65:3000/user/login',
        method:'POST',
        data:{
          username:"wang",
          password:"123123",
          // header:{
          //   user:'60a8a71256ae60584bb0b37f'//user:'id'
          //   }
          },
        })
        },
    async getList(){
      const data = await this.aGet('/admin/shopList');
      console.log('data',data);
      this.list=data;
    }
  }
}
</script>
 